execute as @e[tag=StreamBarrierSpawner,type=marker,predicate=vs:periodic_20tick,tag=isEnable] unless score @s short_circuit_timer matches -2147483648..2147483647 run function vs:system/game_ctrol/stream_barrier_spawner/power/remove_bytime

#power
execute as @e[tag=StreamBarrierSpawner,type=marker] unless score @s short_circuit_timer matches -2147483648..2147483647 at @s run function vs:system/game_ctrol/stream_barrier_spawner/power

#input power
execute as @e[tag=StreamBarrierSpawner,type=marker] unless score @s short_circuit_timer matches -2147483648..2147483647 at @s if items block ~ ~ ~ container.4 *[custom_data~{id:"battery"}] run function vs:system/game_ctrol/stream_barrier_spawner/power/input

#hitbox
execute as @e[tag=StreamBarrierSpawner,type=marker] at @s positioned ~ ~1 ~ if data entity @n[distance=..1,type=interaction,tag=StreamBarrierSpawner.hitbox] attack run function vs:system/game_ctrol/stream_barrier_spawner/hit_box/hit with entity @n[distance=..1,type=interaction,tag=StreamBarrierSpawner.hitbox] attack

#update display
execute as @e[tag=StreamBarrierSpawner,type=marker] at @s run function vs:system/game_ctrol/stream_barrier_spawner/text_update

#short circuit
execute as @e[tag=StreamBarrierSpawner,type=marker,scores={short_circuit_timer=-1..}] at @s run function vs:system/game_ctrol/stream_barrier_spawner/short_circuit/ing
    #stream mob
    execute as @e[tag=StreamBarrierSpawner,type=marker] at @s if entity @e[distance=..10,tag=StreamMob,type=zombie] run function vs:system/game_ctrol/stream_barrier_spawner/short_circuit/start_by_stream_mob